ostree: avoid a segfault
authorMatthias Clasen <mclasen@redhat.com>
Sun, 6 May 2012 00:59:23 +0000 (20:59 -0400)
committerColin Walters <walters@verbum.org>
Sun, 6 May 2012 17:56:57 +0000 (13:56 -0400)
When running ostree --repo=/ostree/repo without further arguments,
we end up calling strcmp with one argument being NULL.

src/ostree/ot-main.c

index f328faf27e951075c9380c21c80ec7259af48736..3bdc4b3da6f49a2b9079850b2e129d07646f9b5b 100644 (file)
@@ -140,7 +140,7 @@ ostree_main (int    argc,
   builtin = builtins;
   while (builtin->name)
     {
-      if (strcmp (cmd, builtin->name) == 0)
+      if (g_strcmp0 (cmd, builtin->name) == 0)
         break;
       builtin++;
     }